﻿<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta content="target-densitydpi=320,width=750,user-scalable=no" name="viewport" />
    <meta content="no" name="apple-touch-fullscreen" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />

    <title>开奖结果</title>
    <link href="css/css.css" rel="stylesheet" type="text/css">
<link href="css/red.css" rel="stylesheet" type="text/css"><script src="js/jquery.1.8.2.min.js"></script><script src="js/style.js"></script>    <!--<link href="css/css.css" rel="stylesheet" type="text/css">-->
    <!--<script src="js/jquery.1.8.2.min.js"></script>-->
    <!--<script src="js/style.js"></script>-->
    <link rel="stylesheet" href="css/dropload.css">
    <script src="js/dropload.min.js"></script>
    <style type="text/css">
	.mycolor{
	display: inline-block;
    width: 60px;
    height: 60px;
    text-align: center;
    line-height: 60px;
    border-radius: 35px;
    color: white;
    margin-bottom: 35px;
    margin-right: 0.5rem;
        text-shadow: 0 0 1px #000;
	}
.color1{background-color:#fcf53c}
.color2{background-color:#4990e2}
.color3{background-color:#4a4a4a}
.color4{background-color:#f6a623}
.color5{background-color:#50b8e3}
.color6{background-color:#5d12fe}
.color7{background-color:#b4b3b3}
.color8{background-color:#d0011b}
.color9{background-color:#801111}
.color10{background-color:#7ed321}
	</style>
</head>
<body>
<header>
    <em onclick="history.go(-1)">返回</em>
    <h1>开奖结果</h1>
</header>
<section>
            <div class="teamSearchW teamSearchT">
            <div class="teamSearch">
                <input type="text" class="inputDate" placeholder="开奖时间：今天"  />
                <input name="date" type="date" placeholder="开奖时间：今天" onchange="getData()"/>
                <em></em>
            </div>
            <div class="teamSearch">
                <input type="text" class="sel" value="幸运28" />
                <select class="select" name="type" onchange="getData()" >
                                        <option value="1">幸运28</option>
                                        <option value="3">加拿大28</option>
                                        <option value="2">北京PK10</option>
                                        <option value="4">幸运飞艇</option>
                                    </select>
                <em></em>
            </div>
            <!--<div class="teamSearchCeng">-->
            <!--<div class="teamSearchCondition clearfix">-->
            <!--<div>-->
            <!--<span>从：</span><label><input type="text" placeholder="年"></label>-->
            <!--</div>-->
            <!--<div>-->
            <!--<span>到：</span><label><input type="text" placeholder="年"></label>-->
            <!--</div>-->
            <!--</div>-->
            <!--<div class="teamSearchButton"><button>查询</button><button class="cancel">取消</button></div>-->
            <!--</div>-->
        </div>
    <div class="prize">
        <ul id="record_list">
        </ul>
    </div>
</section>
    <script type="text/javascript">
        var start_time = 0;
        var lottery_type = 0;
        //条件筛选s
        function getData() {
            start_time = $("input[name=date]").val();
            lottery_type = $("select option:selected").val();      
            pageData();
        }
        
        function pageData() {
            var page = 1; //页码
            $('#record_list').html("");
            $('.dropload-down').remove();
            
            // dropload
            $('.bettingRecordList').dropload({
                scrollArea : window,
                loadDownFn : function(me){
                    //拼接
                    var result = '';
                    $.ajax({
                        type: 'GET',
                        url: "https://www-pc77.com/?m=web&c=openAward&a=dataList" + "&date=" + start_time + "&lottery_type=" + lottery_type + "&page=" + page,
                        dataType: 'json',
                        success: function(data){                          
                            var dataLen = data.list.length;
                            if(page>2){
                                $('.zhanwei').removeClass('zhanwei');
                            }else if (dataLen > 0){
                                $('.zhanwei').removeClass('zhanwei');
                            }else {
                                $('.prize').addClass('zhanwei');
//                                var mainTop = $(".bettingRecordList").offset().top;
//                                var newHeight = windowHeight-mainTop;
//                                $(".bettingRecordList").css({height:newHeight});
                            }
                            if (dataLen > 0) {
                                if(lottery_type == 2 || lottery_type == 4){
                                	console.log(data);
                                    for(var i=0; i < dataLen; i++) {
                                        var str = '';

                                        for(var j=0; j<data.list[i].spare_2.length; j++){
                                            if(data.list[i].spare_2[j]!=""){
                                                var spare_2 =  data.list[i].spare_2[j].split("-");
                                                str += '<em class="colorDan" style="background:'+spare_2[1]+' ">' + spare_2[0] + '</em>';
                                            }


                                        }
                                        result +=  '<li>'
                                            + '<div class="prizeNo"><h3>第' + data.list[i].issue + '期</h3><span>' + data.list[i].open_time + '</span></div>'
                                            + '<div class="prizeResult"><h4>'+data.list[i].open_result+'</h4>'
                                            + '<span>' + str + '</span>'
                                            + '</div>'
                                            + '</li>';
                                    }
                                }else {
                                    for(var i=0; i < dataLen; i++) {
                                        var str = '';

                                        for(var j=0; j<data.list[i].spare_2.length; j++){
                                            if(data.list[i].spare_2[j]!=""){
                                                var spare_2 =  data.list[i].spare_2[j].split("-");
                                                str += '<em class="colorDan" style="background:'+spare_2[1]+' ">' + spare_2[0] + '</em>';
                                            }


                                        }
                                        result +=  '<li>'
                                            + '<div class="prizeNo"><h3>第' + data.list[i].issue + '期</h3><span>' + data.list[i].open_time + '</span></div>'
                                            + '<div class="prizeResult"><h4>' + data.list[i].spare_1 + '=<em class="colorH">' + data.list[i].open_result + '</em></h4>'
                                            + '<span>' + str + '</span>'
                                            + '</div>'
                                            + '</li>';
                                    }
                                }
                            }else{
                                // 锁定
                                me.lock();
                                // 无数据
                                me.noData();
                            }

                            // 为了测试，延迟1秒加载
                            setTimeout(function(){
                                $('#record_list').append(result);
                                // 每次数据加载完，必须重置
                                me.resetload();
                            },1000);
                        },
                        error: function(xhr, type){
                            // 即使加载出错，也得重置
                            me.resetload();
                        }
                    });
                    
                    page++; //页面加1
                },
                threshold : 50
            });
        }
        
        getData();
    </script>
</body>
</html>